//level的change事件函数
function levelChange(){
	$("#userLevel").change(function(){
		var obj=document.getElementById("userLevel");
		var index=obj.selectedIndex; //序号，取当前选中选项的序号
		var level = obj.options[index].value;
		if(level==0 || level==1){
			document.getElementById("college_line").style.display = "none";
			//document.getElementById("class_line").style.display = "none";
			
			$("#selectRole").empty();
			$("#selectRole").append("<option value=''>未选择</option>");
			$("#selectRole").append("<option value='2'>就业管理员</option>");
		}
		else if(level==2){
			document.getElementById("college_line").style.display = "block";	
			//document.getElementById("class_line").style.display = "none";
			
			$("#selectRole").empty();
			$("#selectRole").append("<option value=''>未选择</option>");
			$("#selectRole").append("<option value='1'>学院副书记</option>");
			
			queryCollege();
		}
	});
}

//列出所有学院
function queryCollege(){
	$.post(
		"../ajax/queryListCollege.asp",
		function(data){
			if (data!=null){
				var collegeData = eval(data.collegeData);
				$("#collegeid").empty();
				$("#collegeid").append("<option value=''>未选择</option>");
				for(var i = 0; i<collegeData.length; i++){
					$("#collegeid").append("<option value='"+collegeData[i].collegeid+"'>"+collegeData[i].collegename+"</option>");
				}
			}
		},
		"json"
	);	
}